//原始数据类型
let iNum=2
let fNum=3.2
let eNum=.32e10
let bNum=0b10010
const PI = Math.PI
let str = "Hello World"
let tBool = true
let fBool = false
let undef = undefined
let nvl = null

console.log(iNum + "的类型是" + typeof iNum)
console.log(fNum + "的类型是" + typeof fNum)
console.log(eNum + "的类型是" + typeof eNum)
console.log(bNum + "的类型是" + typeof bNum)
console.log(PI + "的类型是" + typeof PI)
console.log(str + "的类型是" + typeof str)
console.log(tBool + "的类型是" + typeof tBool)
console.log(fBool + "的类型是" + typeof fBool)
console.log(undef + "的类型是" + typeof undef)
console.log(nvl + "的类型是" + typeof nvl)

//浮点数误差
let a = 0.3-0.2
let b = 0.2-0.1
let compareAB = a===b

console.log('0.3-0.2='+a)
console.log('0.2-0.1='+b)
console.log('a===b结果是：'+compareAB)

//溢出与NaN
let outOfVal = Number.MAX_VALUE*2
let outOfVal2 = Number.MIN_VALUE/2

console.log('上溢的值是：' + outOfVal)
console.log('下溢的值是：' + outOfVal2)

let NaNVal = 0/0
console.log('0/0='+NaNVal)
console.log(NaNVal===NaN)
console.log(isNaN(NaNVal))

console.log(isFinite('a'))
console.log(Number.isFinite('a'))

//字符串
let common = "abcd123"
let chinese = "你好中国"
let sepecial = "♥️"
console.log(common.length)
console.log(chinese.length)
console.log(sepecial.length)

//Symbol
let sym1 = Symbol()
let sym2 = Symbol()
let sym3 = Symbol("hello")
let sym4 = Symbol("hello")
let sym5 = Symbol.for("hello")
let sym6 = Symbol.for("hello")

console.log(sym1)
console.log(sym2)
console.log(sym3)
console.log(sym4)
console.log(sym5)
console.log(sym6)
console.log(sym1===sym2)
console.log(sym3===sym4)
console.log(sym4===sym5)
console.log(sym5===sym6)
